package com.conan.algorithm;

import java.util.Arrays;

public class Lecode088 {
    public static void main(String[] args) {
        int [] num1= {1,2,3};
        int [] num2= {3,4,5};
        int[] num3 = merge(num1,num1.length,num2,num2.length);

        for (int i = 0; i < num3.length; i++) {
            System.out.print(num3[i]);
        }
    }

    public static int[] merge(int[] nums1, int m, int[] nums2, int n) {
        int [] result = Arrays.copyOf(nums1, m+n);

        for(int i = 0; i != n; i++){
            result[m+i] = nums2[i];
        }
        Arrays.sort(result);
        return result;
    }
}
